'''
Created on 2017年2月28日

@author: Administrator
'''
# print ("hello world", end="---");
# print ("你好，世界"*2);
# print ("你好，世界", "hello", sep="-");
# if True:
#     print ("True")
# else:
#     print ("False")
# this is an explain
'''
this is a multi-line explain
this is a multi-line explain
this is a multi-line explain
'''
# a = 60
# b=3.0
# c="re"
# d,e,f=5,'te',a*3*'k'
# print(a,b,c,sep='-')
# print(d,e,f,sep='-')
# ss = "abcdef"
# print(ss[0:-1])
# print(ss[2:5])
# print(id(a))
# list_2d = [ [1 for i in range(3)] for i in range(5)]
# print(list_2d)
# print(range(5))
# print(1 for i in range(3))
# map = {"a":"s1",("f","re"):"s2"}
# print(map)
# print(map["a"])
# del map['a']
# print(map[('f','re')])
# a,b= 1,2
# while b<10000:
#     print(b,end=',')
#     a,b=b,a*b
# c=int(input("input the num"))
# print(c)
# import sys
# 
# def fibonacci(n): # 生成器函数 - 斐波那契
#     a, b, counter = 0, 1, 0
#     while True:
#         if (counter > n): 
#             return
#         yield b
#         a, b = b, a + b
#         counter += 1
# f = fibonacci(10) # f 是一个迭代器，由生成器返回生成
# 
# while True:
#     try:
#         print (next(f), end=" ")
#     except StopIteration:
#         sys.exit()
# def func(a,b):
#     counter = 0
#     while True:
#         if(counter<10):
#             if(counter==9):
#                 print(a)
#             else:
#                 print(a,end=' ')
#             a,b=b,a+b
#             counter +=1
#         else:
#             break
# a,b=1,2
# func(a,b)
# print('a:',a)
# print('b:',b)        
# a,b=['aa'],['bb','cc','dd']
# 
# def func(a,*b):
#     print(a)
#     j=2
#     for i in b:
#         print('第',j,'个参数：',i)
#         j+=1
# func(a,b,a,b,a,b)
d=8
# def func(a,b):
#     c=9
#     def inner(a,b):
#         print('d:',d)
#         print('result:',a+b+c)
#         return 'rst'
#     return inner
# print(func(3,4)(2,3))
# a=['aa','bb','cc']
# b=[x for x in a]
# c=[[a[i] for y in range(2)] for i in range(3)]
# d=[[1 for i in range(2)] for y in range(3)]
# print(d)
# print(b[0])
# print(c)
# a=set('abcdef')
# print(a)
# b=set("abcdef")
# print(b)
# c={'a','b','cd'}
# print(c)
# a={'a':1,'b':2}
# print(a)
# import sys
# 
# print('命令行参数如下:')
# for i in sys.argv:
#    print(i)
# 
# print('\n\nPython 路径为：', sys.path, '\n')
# import sys
# print(sys.path)
# print(dir())
# print('this is the first param:{0},and this is another param:{1}'.format(1,2,3))
# a=5
# print(repr(a).rjust(2),repr(a*a).rjust(3),repr(a*a*a).rjust(4))
path='C:\\Users\\Administrator\\Desktop\\python\\1.txt'
p=open(path,'r')
content=p.read()
print(type(content))
# p.write('python file write test')
print('-')
print('=',content)
p.write(' this is append content')
content=p.read()
print(content)
p.close()
